package com.youlai.springbootstarter;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zc
 * @date 2023-03-17 21:51
 */
@Configuration
@EnableConfigurationProperties(YoulaiProperties.class)
public class YoulaiAutoConfiguration {

    private final YoulaiProperties properties;

    public YoulaiAutoConfiguration(YoulaiProperties properties) {
        this.properties = properties;
    }

    @Bean
    public YoulaiService myService() {
        return new YoulaiService(properties.toString());
    }
}
